{% extends 'base.html' %}
{% load static %}
{% block title %}
    Post a reply
{% endblock %}
{% block breadcrumb %}
<li class="breadcrumb-item">
    <a href="{% url 'Home' %}">
        Boards
    </a>
</li>
<li class="breadcrumb-item">
    <a href="{% url 'board_topics' topic.board.pk %}">
        {{ topic.board.name }}
    </a>
</li>
<li class="breadcrumb-item">
    <a href="{% url 'topic_posts' topic.board.pk topic.pk %}">
        {{ topic.subject }}
    </a>
</li>
<li class="breadcrumb-item active">
    Post a reply
</li>
{% endblock %}
{% block content %}
<form method="post" class="mb-4">
    {% csrf_token %}
    {% include 'includes/form.html' %}
    <button type="submit" class="btn btn-success">
        Post a reply
    </button>
</form>
{% for post in topic.posts.all %}
<div class="card mb-2">
    <div class="card-body p-3">
        <div class="row mb-3">
            <div class="col-6">
                <strong class="text-muted">{{ post.created_by.username }}</strong>
            </div>
            <div class="col-6 text-right">
                <small class="text-muted">{{ post.created_at }}</small>
            </div>
        </div>
    {{ post.message }}
    </div>
</div>
{% endfor %}
{% endblock %}
